﻿using SharpSoft.WPF.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WPF.DEMO.Pages
{
    /// <summary>
    /// Gallery3DPage.xaml 的交互逻辑
    /// </summary>
    public partial class Gallery3DPage : Page
    {
        public Gallery3DPage()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            g3d.CameraPosition = new System.Windows.Media.Media3D.Point3D(0, 0, 30);
        }

        private void btn_anito_Click(object sender, RoutedEventArgs e)
        {
            if (g3d.Children.Count > 0)
            {
                Random random = new Random();
                var index = random.Next(-g3d.Children.Count/3, g3d.Children.Count/3);
                g3d.AnimationTo(index);

            }

        }

        private void StackPanel_Checked(object sender, RoutedEventArgs e)
        {
            if (e.Source is RadioButton rb&&rb.Tag is IGallery3DPositionProvider pp)
            {
                g3d.PositionProvider = pp;
            }
        }

        private void btn_go0_Click(object sender, RoutedEventArgs e)
        {
            g3d.Offset = 0;
            g3d.CurrentIndex = 0;

        }
    }
}
